Restricted multi-scale inference for machine learning

ABSTRACT

Techniques for utilizing multiple scales of images as input to machine learning (ML) models are discussed herein. Operations can include providing an image associated with a first scale to a first ML model. An output of the first ML model can include a first bounding box indicative of a first region of the image representing a first object, with the first bounding box falling within a first range of sizes. Next, a scaled image can be generated by scaling the image. The scaled image can be provided to a second ML model, which can output a second bounding box indicative of a second region of the image representing a second object, the second bounding falling within a second range of sizes. Thus, inputting a scaled image to a same ML model (or to different ML models) can result in different detected features in the images.

BACKGROUND

Computer vision is mission critical to some applications, such asoperating autonomous vehicles. Equipping a computer with functionalitythat imitates human vision may include building software components thattake an image, identify salient portions from the image, and representthe salient portions of the image to the computer in a form that thecomputer can use to conduct further operations. One form of softwarethat can be built to equip a computer with such functionality aremachine-learned (ML) models.

Previous attempts to train ML models to identify salient portions of animage have resulted in flawed ML models. For example, some forms of MLmodel training result in a ML model that cannot properly distinguishbetween objects that are proximate to each other (e.g., a pedestrianthat passes in front of another pedestrian in the camera's view),resulting in extraneous and/or inaccurate identifications of one or bothobjects.

Moreover, some ML models provide more accurate object identificationsthan such flawed ML models, but require too much computation to beuseful for a real-time application and/or may require expensive andspecialized computing equipment that may not suit a particular use. Forexample, an autonomous vehicle using an ML model for computer vision mayreceive a video stream and may be required to make decisions to operatethe autonomous vehicle every 50 milliseconds or less. Because of thecompute time required for some of these ML models to identify an object,the object detected may have moved significantly enough by the time theobject is detected, and accordingly, the object detection is no longerreliable for decision-making. For example, some of these ML models mayrequire a compute time over 100 milliseconds.

BRIEF DESCRIPTION OF THE DRAWINGS

The detailed description is described with reference to the accompanyingfigures. In the figures, the left-most digit(s) of a reference numberidentify the figure in which the reference number first appears. Thesame reference numbers in different figures indicate similar oridentical items.

FIG. 1 illustrates an example image for an example scenario, includingan example aerial view of the scenario.

FIG. 2A illustrates an example image and how such an image may bediscretized as a grid.

FIG. 2B illustrates example regions of interest (ROIs) and portions ofthe image for which the ROIs were generated.

FIG. 3 illustrates example ground truths indicating two areas andexample shrunken ground truths indicating second, smaller areas.

FIGS. 4A-4D illustrate example ROIs, example confidence scoresassociated with the ROIs, and portions of the image for which the ROIswere generated.

FIG. 5 illustrates the example ROIs of FIGS. 4A-4D, relative to an areaindicated by a ground truth, and associated with a degree of alignmentof the example ROIs to the area indicated by the ground truth.

FIGS. 6A and 6B illustrate a flow diagram of an example process fortraining an ML model according to non-maximum suppression replacementtechniques discussed herein.

FIG. 7A illustrates an example first response curve of a first ML modelto objects having various sizes within image(s).

FIG. 7B illustrates an example second response curve of a second MLmodel to objects having various sizes within image(s).

FIG. 8A illustrates an example image provided, as input, to a first MLmodel, and ROI(s) generated by the first ML model responsive toreceiving the first scaled image, according to the techniques discussedherein.

FIG. 8B illustrates the example image of FIG. 8A, rescaled as a secondscaled image, and provided, as input, to the first ML model, and ROI(s)generated by the first ML model responsive to receiving the secondscaled image, according to techniques discussed herein.

FIG. 8C illustrates the example image of FIG. 8A provided, as input, toa second ML model, and ROI(s) generated by the second ML modelresponsive to receiving the example image, according to the techniquesdiscussed herein.

FIG. 9A illustrates an example ROI generated for a portion of an exampleimage.

FIG. 9B illustrates an example plurality of ROIs associated with a sameobject in the example image.

FIG. 9C illustrates an example object segmentation, according techniquesdiscussed herein.

FIG. 10 illustrates an example system for implementing the techniquesdiscussed herein.

DETAILED DESCRIPTION

The techniques discussed herein improve computer vision by increasingthe accuracy of object detection and decreasing the compute time forobtaining accurate object identifications so that objects may bedetected in real time for use in applications such as autonomous vehiclecontrol. Other applications of the techniques discussed herein arecontemplated such as, for example, video games, augmented reality, etc.

The techniques discussed herein may include providing an image to an MLmodel and receiving, from the ML model, multiple regions of interest(ROIs) for different portions of an image. These ROIs may be any form ofidentifying what the ML model believes to be the existence of an objectin the image. For example, an ROI may include a box indicative of pixelsidentified as being associated with the detected object (a “boundingbox”), a mask that includes pixels that correspond to the detectedobject, etc.

In some instances, the ML model may additionally, or alternatively,output confidence scores (or confidence information) associated witheach of the multiple ROIs. For example, the ML model may detect thepresence of an object from a portion of the image, and may generate anROI to indicate where that object is in the image. The ML model mayadditionally, or alternatively, produce a confidence score thatessentially indicates how confident the ML model is that the ML modelactually identified a salient object in the image and/or how well theROI fits the object. For example, a confidence score may be a valuebetween 0 and 1, where 0 represents an indication by the ML model thatthe ML model is not at all confident that an object appears in the ROIand where 1 indicates that the ML model is strongly confident that anobject appears in the ROI, although other permutations are contemplated.In other words, the ML model outputs an indication of where it thinks anobject might be and a score that indicates how confident the ML model isthat it correctly identified an object and/or how well the ROI pointsout where the object is in the image.

Some of the techniques discussed herein are directed to training the MLmodel to produce better ROIs (ROIs identifying where the object is inthe image more accurately) and/or more accurate confidence scores (e.g.,producing a score closer to 0 for an ROI that does not contain an objectand/or a score closer to 1 for an ROI that does indicate a salientobject) and to reduce the compute time to achieve ROIs of such anaccuracy.

The ML model may include a neural network, such as a random forestand/or boosted ensemble of decision trees; a directed acyclic graph(DAG) (e.g., where the nodes are organized as a Bayesian network); deeplearning algorithm(s), such as artificial neural networks (ANN) (e.g.,recurrent neural network (RNN), residual neural network (ResNet)), deepbelief network (DBN), deep stacking network (DSN); etc. Loss functionsfor training the ML model may include, for example, determining a degreeof alignment of the ROI to an area of the image indicated by a groundtruth as representing an object. In some instances, determining thedegree of alignment of the ROI to the area indicated by the ground truthmay include determining an intersection over union (IoU) for the ROI,which is one metric for determining how well the ROI “fits” the groundtruth. Other indications of a fit of the ROI to the area indicated bythe ground truth may be used. In some instances, the ground truth can bereferred to as a reference region.

Because training ML models may include providing tens of thousands, andeven hundreds of thousands of images or more to the ML model and makingsuch corrections to the weights, it is advantageous to identify thoseROIs which the ML model got most wrong. This vastly decreases the timespent training an ML model and may increase the accuracy of the ML modelsince corrections made to the ML model to account for “very wrong” ROIsand/or confidence scores aren't washed out by reinforcing learning of“correct” ROIs and/or confidence scores.

In some instances, the techniques discussed herein may include selectingparticular examples for training the ML model. Selecting these examplesmay include hard example mining, for example, which may include sortingmultiple ROIs by confidence scores (e.g., greatest confidence scores toleast) and/or error in confidence score (e.g., a confidence score errorassociated with an ROI, for an ROI that was suppressed according to NMS)and choosing the top n number of ROIs. In some instances, selectingexamples by hard example mining may exclude the ROI associated with amaximum confidence score (or scores). Additionally, or alternatively,the techniques may include choosing n number of random ROIs. In someinstances, the number, n, may be chosen to be the number of positiveexamples in the image (e.g., positively identified ROIs corresponding toobjects represented in the image).

However, in some training schemes (such as training on a portion, e.g.,30% of an area representing an object as opposed to the whole area, aswill be described in more detail herein), merely selecting a top nnumber of ROIs (by confidence score) may skew the ML model trainingbecause frequently, at least some of the top n number of ROIs tend tocorrectly identify an object. Since those examples adequately predictthe expected ROI, such selected examples should not be penalized. Aswill be discussed in detail below, techniques may include suppressingsome of the top n ROIs from being chosen to train the ML model andselecting new ROIs to replace the suppressed ROIs. Additionally, oralternatively, an example chosen as a hard negative example, but thatagreed with a region of interest, may instead be reassigned as apositive example. In other words, networks (such as those describedherein) may disambiguate between actual hard examples and examples whichshould not be penalized for training. Regardless, in at least someexamples, such chosen example may include backpropagation (either topenalize as an actual hard negative example, or to improve as a goodexample).

In some instances, such techniques may exclude portions of image datafor training based at least in part on determining (1) that a degree ofalignment of an ROI associated with the portions to a ground truth forthe object indicated by the ROI meets or exceeds a threshold degree ofalignment (e.g., the ROI fits the area indicated by the ground truth“well”), and (2) that the ROI was generated for a portion of the imagethat is within the area indicated by the ground truth. On the otherhand, an ROI produced from a portion of the image that lies outside theground truth, no matter how well the ROI fits the ground truth, may beincluded in the subset for training (the “training subset”) andpenalized in the loss function. Similarly, an ROI produced for a portionof the image that lies within the ground truth, but produces a “bad” ROI(e.g., the degree of alignment of the ROI to the ground truth is lessthan a threshold degree of alignment) may be included in the trainingsubset and penalized in the loss function. In some instances, the top nexamples may be selected for inclusion in the training subset, excludingthose examples discussed above in accordance with the technique. Thistechnique that uses the exclusion/inclusion rules discussed herein isreferred to herein as an improved hard example mining technique.

The training subset (determined by the exclusion/inclusion rules) may beprovided to a loss function. Such a loss function may comprise, forexample, a cross-entropy loss function, a Huber loss function (e.g., forthe confidence score in examples where the confidence score is includedin the training/loss determination with the ROI associated therewith),mean-squared error, focal loss function, etc.

In some instances, the techniques may include training the ML modelusing multiple stages. The stages may include providing a first batch ofimages (whether scaled or not) to the ML model and training the ML modelusing hard examples according the procedure above from the first batchof images. In some instances, the first batch may include tens ofthousands or hundreds of thousands of images.

In some instances, training the ML model may include may include asecond stage that follows the first stage. Training the ML model duringthe second stage may comprise using the training subsets which includeshard examples. In some instances, the second stage may additionallyinclude training the ML model using a focal loss function. In someinstances, the focal loss function may modify the loss computed by across entropy loss function (or any other loss function) so that theloss (errors) calculated for well-classified ROIs are downweighted andthe loss calculated for poorly-classified ROIs is less weighted.

In some instances, the receptive field of the ML model may cause the MLmodel to produce ROIs for objects that are too large for the receptivefield that are associated with a poor confidence score and/or errorvalue. For example, if a human were to stand with their nose touchingagainst a painting, it would be very difficult to identify the painting,let alone to identify particular objects in the painting. This isbecause the salient portions of the painting are outside the human'sreceptive field.

Similarly, an ML model may poorly detect objects that are outside thereceptive field of the ML model (e.g., objects that are too large forenough of the object to fall into the receptive field for the ML modelto “see” the object and comprehend what the ML model “sees”).

Some techniques for remedying this problem have included providing, asinput to an ML model, an image, using the ML model to obtain objectswithin a size range, followed by down-scaling the image and re-runningit through the ML model so that objects that were formerly outside thesize range now fall within the size range (after being scaled). This maybe repeated iteratively. Note that scaling the image down makes largeobjects appear to be smaller in the scaled-down image, allowing them tofall within the receptive field of the ML model. While it may bepossible to train an ML model with a receptive field that issubstantially similar to the size of the input image, such an ML modelmay be slow or not responsive enough, for example, for use in autonomousdriving.

In an additional or alternate instance, the techniques described hereinmay include determining a response curve associated with a first MLmodel that indicates the accuracy of the first ML model to classify(e.g., produce an ROI and/or confidence score for) an object over anapparent object size in an image. In some instances, producing thisresponse curve may include providing multiple objects in image(s) to thefirst ML model and tracking how well the first ML classifies objects ofdifferent sizes. The techniques may include determining an accuracy ofan ROI and associating the accuracy and a size of the ROI (e.g., aheight, a width, an area). In at least some instances, output sizes ofthe ML model may be constrained based on an optimal region based on theinput scale size. As a non-limiting example, an ML model which takes a640×480 image as input may be constrained to output ROIs having pixelsizes on the order of 100×100 to 200×200, while an ML model which takesa 940×940 image as input may be constrained to output ROIs having pixeldimensions on the order of 250×250 to 300×300 pixels.

These accuracy/ROI size pairs may be amalgamated for each ROI determinedfor the first ML model. The techniques may include identifying a rangeof ROIs associated with accuracies that meet or exceed a thresholdaccuracy. This range of sizes may indicate that the first ML modeldetermines “good” ROIs for objects in that range of sizes. In someinstances, the first ML model may output ROIs that have sizes within thesize range and may suppress other ROIs determined by the ML model.

In some instances, the first batch of images may be scaled down, using ascale factor (e.g., 0.75, 0.5), and the batch of scaled images may beprovided, as input, to a second ML model. A second response curve and asecond range of sizes may similarly be determined for the second MLmodel, based at least in part on the batch of scaled images.

In some instances, at run time, an image may be provided, as input, tothe first ML model; the image may be scaled and provided, as input, tothe second ML model; and the ROIs output by the first ML model may berestricted to ROIs within the first range and the output of the secondML model may be restricted to ROIs within the second range. The MLmodels may be trained such that the different ranges of ROIs associatedwith the different ML models overlap and/or abut each other so that alarger range of object sizes may be detected by multiple ML models.

Put simply, the techniques may include training at least two ML modelsand determining a range of ROI sizes for which each ML model produces“good” ROIs. That way, instead of repetitively providing an image to anML model, receiving outputs, scaling the image, re-providing it to theML model, receiving second outputs, and so on, the process may beshortened and accuracy increased by providing scaled versions of thesame image to multiple ML models (e.g., providing a first scaled imageto a first ML model, a second scaled image to a second ML model, and soon, where the scaled images are scaled versions of a same unscaledimage), where each ML model is trained to respond best to a small rangeof sizes and is constrained to output ROIs within that small range. Ingeneral, such a technique may improve the speed and performance ofdetecting objects in images, while reducing memory requirements (e.g.,reduced GPU memory requirements).

The techniques described herein may also include techniques forproviding, as input to an ML model, an image and receiving, as outputfrom the ML model, both an ROI and an object segmentation (e.g., mask,contour set) identifying specific pixels (or other portions of theimage) associated with an object detected in the image. Instead ofrequiring a second ML model and/or a second operation to segment theimage (e.g., identify which pixels correspond with the detected object,e.g., by outputting a mask or set of lines and/or curves), thetechniques discussed herein substantially simultaneously (e.g., withintechnical tolerances) detect an object (e.g., determine an ROI) andsegment the image.

In some instances, the techniques for instance segmentation (e.g.,segmenting an image on a pixel by pixel basis) may include receiving, ata ML model, an image; and determining an ROI for a portion of the image(e.g., a pixel, a cluster of pixels) and a confidence score associatedtherewith, until the ML model has determined a plurality of ROIs and aplurality of confidence scores associated therewith for a plurality ofportions of the image. In some instances, the ML model may detect animage by selecting, for output, an ROI associated with a maximumconfidence score (“output ROI”). To segment the region of the image thatrepresents the object that the output ROI identifies, the techniques mayinclude determining that a subset of the plurality of ROIs associatedwith confidence scores meet or exceed a confidence score threshold,substantially overlap with the ROI associated with the maximumconfidence score, and/or are within a threshold confidence of themaximum confidence score; and concatenating the portions from which theROIs were determined to an image segmentation (e.g., by adding a pixelto a mask, by modifying a curve to include the pixel).

Explained differently, to decide whether to include data (e.g., a pixel)of the image in an instance segmentation (which may be a mask), thetechniques may include determining whether an ROI associated with thatparticular pixel (or portion of a feature map) is substantially similarto a representative ROI and its corresponding confidence value. In atleast one example, the instance may comprise all pixels corresponding toa single ROI which would be suppressed under non-maximum suppression(also referred to as non-maximal suppression).

In some instances, training an ML model to produce an instancesegmentation for an object may include training based on a ground truthmask and an associated ROI of the object. In such an example, the lossfunction may be configured to penalize portions of the image outside ofthe mask for producing an ROI with a confidence score over a predefinedvalue. In other words, pixels (or regions) of an image such an ML modelshould not output an ROI if such pixels would fall outside of the maskof an object associated with the pixel (or region), even if the ROI isadequate. Although this specification predominantly discusses theinstance segmentation as resulting in outputting a pixel mask, it iscontemplated that any suitable method for identifying a subset of theimage may be used (e.g., outputting a set of points, lines, curves,and/or other edge indicators).

Example Scenario

FIG. 1A illustrates an example image 100 and an example aerial view ofan example scenario 102 from which the example image 100 may have beengenerated. The example scenario 102 may include an autonomous vehicle104, and three other vehicles 106, 108, and 110 that are operating in asame environment as the autonomous vehicle 104 (e.g., the city blockdepicted in the example image 100, which may include the driving surfacedepicted in the aerial view of the example scenario 102). The autonomousvehicle 104 may receive sensor data from one or more sensors of theautonomous vehicle 104. The autonomous vehicle 104 may use this sensordata to determine a trajectory for controlling motion of the autonomousvehicle. The sensor data may include an image such as, for example,example image 100.

In some instances, the autonomous vehicle 104 may be an autonomousvehicle configured to operate according to a Level 5 classificationissued by the U.S. National Highway Traffic Safety Administration, whichdescribes a vehicle capable of performing all safety-critical functionsfor the entire trip, with the driver (or occupant) not being expected tocontrol the vehicle at any time. However, in other examples, theautonomous vehicle 104 may be a fully or partially autonomous vehiclehaving any other level or classification now in existence or developedin the future. Moreover, In some instances, the computer visiontechniques described may be usable by non-autonomous vehicles as well.

According to the techniques discussed herein, the autonomous vehicle 104may receive an image from a sensor 112 of the autonomous vehicle 104 andmay detect object(s) from the image such as, for example, the othervehicles 106, 108, and 110, and/or may segment detected objects in theimage. For example, the autonomous vehicle 104 may identify and segmentthe other vehicles 106, 108, 110; a drivable surface; the trafficlights; etc. In some instances, this detecting and/or segmenting may beaccomplished by providing the image as input to an ML model 114 of aperception engine 116 running on computing device(s) 118 of theautonomous vehicle 104.

In some instances, the perception engine 116 may include one or more MLmodels and/or other computer-executable instructions for detecting,identifying, segmenting, classifying, and/or tracking objects fromsensor data collected from the environment of the autonomous vehicle104, such as ML model 114. In some instances, the autonomous vehicle 104the perception engine 116 may receive sensor data from one or moresensors 112 of the autonomous vehicle 104, determine perception datafrom the sensor data, and transmit the perception data to a planner 120for use by the planner 120 to localize a position of the autonomousvehicle 104 on a global map, determine one or more trajectories, and/orcontrol motion of the autonomous vehicle 104 to traverse a path orroute, though any such operation may be performed in various othercomponents (e.g., localization may be performed by a localizationengine, not shown).

For example, the perception engine 116 may detect an object in theenvironment and classify the object (e.g., passenger vehicle,semi-truck, pickup truck, human, child, dog, ball). The perceptionengine 116 may also determine a track of the object (e.g., historical,current, and/or predicted heading, position, velocity, and/oracceleration of the object). In some instances, the perception engine116 may additionally or alternatively determine a position of theautonomous vehicle 104 determined by a localization engine (notpictured, which may use any sensor data to localize the vehicle 104),data related to objects in the vicinity of the autonomous vehicle 104,route data that specifies a destination of the vehicle, global map datathat identifies characteristics of roadways (e.g., features detectablein different sensor modalities useful for localizing the autonomousvehicle), local map data that identifies characteristics detected inproximity to the vehicle (e.g., locations and/or dimensions ofbuildings, trees, fences, fire hydrants, stop signs, and any otherfeature detectable in various sensor modalities), etc. The data producedby the perception engine 116 may be collectively referred to as“perception data.” Once the perception engine 116 has identified and/orsegmented objects from the image and/or determined other perceptiondata, the perception may provide the perception data, including theobject detections and/or segmentations, to a planner 120.

In some instances, the planner 120 may use perception data, includingthe identified and/or segmented objects, to generate a trajectory forcontrolling motion of the autonomous vehicle 104. For example, theplanner 120 may determine a route for the autonomous vehicle 104 from afirst location to a second location, generate, substantiallysimultaneously, a plurality of potential trajectories for controllingmotion of the autonomous vehicle 104 in accordance with a recedinghorizon technique (e.g., 1 micro-second, half a second) to control thevehicle to traverse the route, and select one of the potentialtrajectories as a trajectory of the autonomous vehicle 104 that may beused to generate a drive control signal that may be transmitted to drivecomponents of the autonomous vehicle 104.

Example Region of Interest (ROI) Generation by ML Model

FIG. 2A illustrates example image 100 and an example output grid 200,where each cell of the output grid 200 identifies a portion of the image100. One example portion of the image 202 is emphasized (bolded) nearthe center of the image 100. It is contemplated that, as discussedherein, a “portion of the image” may include a single pixel of the imageand/or a collection of pixels of the image. In some instances, an outputof the machine learning model is a feature map, wherein an individualcell may represent a portion of a feature map. Such a feature map mayhave multiple channels, each channel associated with various element(s)determined by the model (e.g., a confidence score, a region of interest,etc.). FIG. 2A illustrates an example where a “portion of the image,”e.g., example portion 202, includes a collection of pixels of the image100. A portion of the feature map (e.g., a cell) may be associated witha portion of the image. Example portion 202 may, therefore, be called anexample cell 202 of the example output grid 200.

In some instances, the example output grid 200 may be a manner ofdiscretizing the example image 100 as output by the ML model. Forexample, the ML model may be configured to receive the image and outputone or more ROIs and associated confidence levels per cell of the outputgrid 200. In at least some instances, such an output grid 200 may bediscretized into m/4 by n/4 cells, according to an image of m by npixels. In some instances, the cells may be 4 pixels by 4 pixels, thoughany other discretization is contemplated. In some instances, and asmentioned above, the example image 100 can be discretized into aplurality of portions of a feature map. That is, the examples are notlimited to a grid of cells, and various implementations are contemplatedherein.

In some instances, an ML model may generate an ROI and/or a confidencescore for each portion of the image (e.g., for each cell in FIG. 2A).For example, the ML model may determine an ROI and/or a confidence scorefor example portion 202. In some instances, the ML model may generate anROI that has boundaries of the ROI that extend beyond the boundaries ofthe portion of the image. In at least some instances, each output cellmay correspond with a ROI indicated by a center position (e.g., a <u, v>image coordinate position), extents (e.g., a width and/or height),and/or a confidence level for any one or more classifications. As anon-limiting example, each cell may be associated with a center,extents, and confidence for each of a car, pedestrian, bicyclist,truck/bus, traffic light, and/or stop sign classification.

FIG. 2B illustrates example portions of the image (i.e., cells in theimage) and their associated regions of interest (ROIs) with respect to aclassification of “car.” FIG. 2B illustrates the ROIs as bounding boxes,although it is understood that the region of the image representing anobject may be otherwise indicated (e.g., by a mask). An ML model, asdiscussed herein, may determine ROI 204′ for portion 204 (e.g., cell204), ROI 206′ for portion 206, and ROI 208′ for portion 208. In someinstances, the ML model may determine a first confidence score inassociation with ROI 204′, a second confidence score in association withROI 206′, and a third confidence score in association with ROI 208′. Aconfidence score may indicate a probability that the associated ROIaccurately represents a region of the image that represents an object(here, a car). Each of the ROIs 204′, 206′, and 208′ identifiesdifferent regions of the image that represent different objects, i.e.,vehicles 106, 108, and 110, respectively. In some instances, ROI 204′may be considered a “detection,” by the ML model, of vehicle 106 in theimage 100.

Example Machine-Learning (ML) Model Training Technique

FIG. 3 illustrates a portion 300 of example image 100, an example groundtruth 302 that identifies a first area of the image that represents afirst object (i.e., vehicle 108), example ground truth 304 thatidentifies a second area of the image that represents a second object(i.e., vehicle 110, and two scaled ground truths 302′ and 304′. Examplescaled ground truth 302′ is an area that defines a central 30% of groundtruth 302 (“central 30% box 302”), and example scaled ground truth 304′is an area that defines a central 30% of ground truth 304. Of course,while the example scaled ground truth 302′ is described as correspondingto a central 30% of ground truth 302, any percentage is contemplatedherein.

The following discussion concerns techniques for training the ML modeland how to train the ML model so that the ML model will generate ROIsand/or confidence scores that are more accurate. In some instances,FIGS. 3-6 generally illustrate techniques for determining how topenalize various outputs of the ML model while training.

As illustrated in FIG. 3 , the ML model may be trained only using thosescaled 30% regions as this enables disambiguating between objects thatappear as overlapping in the image 100 (i.e., occlusions), such asvehicles 110 and 112. Note that the ground truth 302 partially occludesground truth 304 overlap, so training the ML model according to thetechnique discussed above may avoid ambiguities when deciding to whichobject should a portion of the image be associated (i.e., which ROI tooutput).

FIGS. 4A-4D illustrate example ROIs, example confidence scoresassociated with the ROIs, and portions of the image for which the ROIswere generated.

FIG. 4A illustrates an example ROI 400′ that the ML model may havedetermined for portion 400 and a confidence score 402 that the ML modelmay have determined for the ROI 400′ for a specific classification suchas “car,” for example. In some instances, the confidence score indicatesa probability, determined by the ML model, that the ROI with which theconfidence score is associated accurately identifies an object in theimage. For example, the confidence score may indicate a probability thatthe ROI fits an area comprising pixels representing the object perfectly(e.g., no pixel identified by the ROI represents something other thanthe detected object, the edges of the ROI encompass edges of the objectwithout intersecting a boundary of the object and leave a minimum amountof space between a boundary of the object and the ROI).

In the example depicted in FIG. 4A, the confidence score 402 is “0.97.”In some instances, the ML model may determine confidence scores between0.00 and 1.00, although other values are contemplated. In that example,a 0.00 may indicate that the ML model does not think the ROI generatedfor a portion of the image identifies an object and/or a 1.00 mayindicate that the ML model is absolutely sure that the ROI identifies anobject, with a perfect degree of alignment.

FIG. 4B illustrates an example ROI 404′ that the ML model may havedetermined for portion 404 and a confidence score 406 that the ML modelmay have determined for the ROI 404′. Note that the ROI 404′ does notfit the region representing the object (i.e., vehicle 110) as well asROI 400′, as it is slightly too small. The confidence score 406, in thisexample, is correctly lower than the maximum confidence score,confidence score 402, at least because the ROI 404′ does not fit theregion representing the object (i.e., vehicle 108) perfectly, or as wellas ROI 400′. Also note that portion 400 continues to be shown as areference point for FIGS. 4B-4D, not to imply that the ROIs of thosefigures are somehow associated with the portion 400.

FIG. 4C illustrates an example ROI 408′ that the ML model may havedetermined for portion 408 and a confidence score 410 that the ML modelmay have determined for the ROI 408′. Note that the ROI 408′ does notfit the region representing the vehicle 108 well, as it is too big andencompasses more objects than just the vehicle 108. Unlike confidencescore 406 that was appropriately lower due to the mediocre fit,confidence score 410 reflects a value of 0.94, which may be consideredtoo high for the poor fit of the ROI 408′ to the region of the imagerepresenting vehicle 108.

FIG. 4D illustrates an example ROI 412′ that the ML model may havedetermined for portion 412 and a confidence score 414 that the ML modelmay have determined for the ROI 412′. Note that the ROI 412′ does notfit the region representing the object (e.g., the vehicle 108) well, asit is much too small. Confidence score 414 reflects a value of 0.13,which is appropriate considering the poor fit of the ROI 412′ to theregion of the image representing vehicle 108.

FIG. 5 illustrates an example of selecting regions for non-maximumsuppression (NMS) reassignment. In general, because of the sparsity ofpositive examples in an image, the ML model may be trained using abalance of positive examples and negative examples to output betterestimations. Training may also incorporate “hard” examples (i.e.,examples which provide a high confidence of being correct, but that arenot correct). In some instances, an equal number of positive, negative,and hard examples are provided to the network for training. In at leastsome instances, confidence levels of all cells (portions of the image)may be sorted and the highest confidences producing an incorrect ROI maybe selected as hard examples. When using the technique illustrated withrespect to FIG. 3 , portions of the image (e.g., cells) which fallwithin a ROI associated with a highest confidence, but were not part ofthe central 30%, may generally be penalized by naïvely indicating suchcells as “hard” examples (i.e., the network may be explicitly trainednot to output an ROI with those cells because they have a highconfidence level, but do not fall within the central 30%). Though thetechnique described with respect to FIG. 3 may aid in disambiguation(providing better ROIs), training models naïvely by penalizing theseportions may lead to poor performance (e.g., bad estimates). Trainingthe model intelligently, as described in detail below, may avoid suchnaïve assumptions.

In some instances, the ML model may determine that portions of the image(e.g., cells) which have been indicated as hard examples are associatedwith an ROI that is suppressed under NMS. In other words, the model maydetermine that a cell selected as a hard example should not be selectedand another hard example should be chosen so as to backpropagate lossfor penalization of a true hard example. In at least some examples, thecell selected as a hard example, but that has output a good box, mayinstead be reassigned as a good example (i.e., such that losses arebackpropagated to improve the output corresponding to the cell). Such aprocess may generally be referred to as NMS reassignment. Variousexamples of portions of an image which should and should not be subjectto NMS reassignment are illustrated in FIG. 5 .

Throughout FIG. 5 , an area indicated by a reference ROI (ground truthROI and/or an ROI determined by non-maximum suppression (NMS))represented by a dotted line (e.g., a reference 500), and degrees ofalignment of the example ROIs are given with respect to the reference500. The portions of the image from which the example ROIs weregenerated continue to be reproduced in FIG. 5 for context, with portion400 reappearing in each for visual context. In some instances, to selectwhich ROI to output, of multiple ROIs that were generated that maycorrespond to the object in the image, the ML model may NMS the multipleROIs, which is to say the ML model may determine which ROI is associatedwith a maximum confidence score and may identify that ROI as the ROI tooutput in associated with the object. In some instances, where multipleobjects of a certain object classification are represented in an image,the ML model may determine a cluster of ROIs that overlap (e.g., thathave degrees of alignment with respect to each other that meet or exceeda threshold degree of alignment), thereby indicating a likelihood thatan object is represented in the image somewhere in the image around thatcluster of ROIs, and may NMS the cluster of ROIs to determine an outputROI for the object. In other words, outputting an ROI in associationwith a single object may be based on determining an ROI associated witha maximum confidence score, of the multiple ROIs that overlap. The MLmodel may repeat identifying clusters and performing NMS with respect tothe clusters until all objects have been identified and subjected toNMS. This may be done for each object classification for which an ROI isdetected. In some instances, identifying a cluster may includeidentifying ROIs associated with confidence scores that exceed aconfidence score threshold in addition to identifying ROIs that overlap.This may be referred to as thresholding the ROIs.

In some instances, to train the ML model, the ML model may determine adegree of alignment between an ROI and the reference ROI 500. In someinstances. Determining the degree of alignment may include determining ametric that reflects an amount of overlap and/or fit of the ROI to theground truth area 500. In some instances, this may include determiningan intersection over union, although other techniques for determining anamount of overlap/an error of the ROI generated by the ML model may beused.

In this example, the ML model may determine that the example ROI 400′fits the ground truth area 500 well, e.g., signified by a degree ofalignment 502 that indicates a 98% degree of alignment/fit of theexample ROI 400′. The example confidence score 402 is appropriatelyhigh, in view of the high degree of alignment. In some instances, a“good” fit may be defined to be a degree of alignment of 0.70 or more.This value (0.70) may be considered a threshold degree of alignmentalthough it is contemplated that other values may be used such as, forexample, 0.80, 0.50 and/or 0.60. Here, example 400′ would be subject toNMS reassignment. In other words, even though 400 is not part of thecentral 30%, it produces a “good” ROI and, as such, should not bepenalized (if selected as a hard example).

Similarly, the ML model may determine that the example ROI 404′ fits thereference ROI 500 well, albeit somewhat worse than example ROI 400′, bydetermining that the ROI 404′ is associated with a degree of alignment504 of 0.90. Nonetheless, example 404 would be subject to NMSreassignment as well (if selected as a hard example).

The ML model may also determine that example ROI 408′ fits the referenceROI 500 poorly, by determining that the ROI 408′ is associated with adegree of alignment 506 (i.e., 0.62 in this example) that fails to meetor exceed a threshold degree of alignment (e.g., 0.70). As such, eventhough the example portion 408 falls within the reference ROI 500, itconstitutes a valid hard example.

Likewise, the ML model may also determine that the example ROI 412′ fitsthe reference ROI 500 poorly, by determining that the ROI 412′ isassociated with a degree of alignment 508 (i.e., 0.47 in this example)that fails to meet or exceed a threshold degree of alignment (e.g.,0.70). Since the confidence score is low (i.e., 0.13 in this example),the ML model may determine the example 408/408′ as a valid hard example.

FIGS. 6A and 6B illustrates a pictorial flow diagram of an exampleprocess 600 for training an ML model based at least in part on a subsetof ROIs selected via NMS reassignment. At operation 602, the exampleprocess 600 may include receiving an image, according to any of thetechniques discussed here.

At operation 604, the example process 600 may include determiningmultiple ROIs (e.g., ROIs 400′, 404′, 408′, 412′, as illustrated in anexample 612) and multiple confidence scores associated therewith,according to any of the techniques discussed herein. For example, the MLmodel may generate an output grid (or more generally, may output afeature map) for the image that includes output cells (or moregenerally, that includes a plurality of features), and may determine anROI (and confidence score associated therewith) per classification foran output cell (e.g., each output cell). As a non-limiting example, eachcell of the output grid may have, for example, ROIs and confidences foreach of a vehicle classification, a bicycle classification, a pedestrianclassification, and the like, though any combination of classificationsis contemplated. This may include generating ROIs like those depicted inFIG. 6A (400′, 404′, 408′, 412′), determined for the exampleclassification “car.”

At operation 606, the example process 600 may include receiving areference ROI (e.g., reference ROI 500, as illustrated in an example614), according to any of the techniques discussed herein. The referenceROI 500 (e.g., a reference region) may be ground truth received viahuman labeling or any other suitable method of establishing a groundtruth for an area of the image that represent an object in the image. Insome instances, the reference ROI may indicate an area of the imageassociated with a classification for which the ROIs were generated. Forexample, ROI 500 may indicate the area of the image representing theclassification “car,” as discussed above. At operation 608, the exampleprocess 600 may include selecting a subset of examples to train the MLmodel, according to any of the techniques discussed herein. This mayinclude determining a portion (e.g., an output cell) of the image, fromamong one or more of all the portions of the image, to include in asubset of examples for training the ML model. For example, the exampleprocess 600 may include determining a positive example (608(a)) toinclude in the subset, determining a negative example (608(b)) toinclude in the subset, and/or determining a hard example (608(c)) toinclude in the subset, using NMS reassignment. These operations arediscussed in more detail below. In some instances, operation 608 mayadditionally or alternatively randomly selecting examples for inclusionin the subset of examples for training the ML model.

Operation 608(a) may include determining that a confidence score for anROI is a maximum confidence score and/or meets or exceeds a confidencescore threshold and that a degree of alignment of the ROI to a referenceROI exceeds a threshold degree of alignment (e.g., which may indicatethat the ROI correctly identifies an object represented in the image).Operation 608(a) may include selecting, as a positive example and basedon this determination, the output cell and/or any of the data generatedby the ML model associated therewith for inclusion in the subset fortraining the ML model.

Operation 608(b) may include determining that a confidence score for anROI is a minimum confidence score and/or does not meet a confidencescore threshold and that a degree of alignment of the ROI to a referenceROI does not meet a threshold degree of alignment. Operation 608(a) mayinclude selecting, as a negative example and based on thisdetermination, the output cell and/or any of the data generated by theML model associated therewith for inclusion in the subset for trainingthe ML model.

Turning to FIG. 6B, operation 608(c) may include (608(c)(1)) selecting ahard example, generally. Hard examples may be referred to as exampleswhich the machine learned model gets the most wrong. For instance, suchhard examples may correspond to cells having a very high confidence of acorresponding ROI, but incorrectly identify such an ROI or shouldotherwise be penalized based on their corresponding output. Generally,hard examples may be negative examples. Selecting a hard example mayinclude identifying those portions of the image (e.g., one or morecells) that produced an incorrect ROI (or should otherwise bepenalized), but are associated with a high confidence score; sorting theportions by confidence scores; and selecting, as a hard example and fromthe sorted remaining ROIs, a top number, n, of associated portions.However, it is understood that any suitable hard example selectionmethod is contemplated.

Once a hard example has been selected, operation 608(c) may include(608(c)(2)) determining whether to suppress the selected hard example,according to any of the techniques discussed herein. In some instances,e.g., those in which only a portion of cells associated with an objectare trained to output associated data (e.g., and ROI), such hardexamples (when naively selected) may, in fact, represent good examplesto train on (e.g., the cells have correctly identified an ROI associatedwith the object, but are penalized as not belonging to, e.g., a central30% of the object). In such instances, operation 608(c)(2) may determineto suppress the selected hard example if the selected hard examplecorresponds to a portion of the image that is within the boundary of theROI region (or otherwise has been associated with a valid output, e.g.,an ROI that corresponds to an object associated with that portion of theimage). Based on determining to suppress the selected hard example, theoperation 608(c)(2) may include discarding the selected hard example andreturning to operation 608(c)(1) to select a new hard example (e.g., thenext most wrong example according to the sorting discussed above). Forexample, discarding the selected hard example may include excluding theselected hard example from the subset for training the ML model andexcluding the selected hard example from the sorted ROIs so that itcannot be selected upon a subsequent selection. In some instances, thedetermination to suppress the selected hard example may additionally oralternatively include determining that a degree of alignment of the ROIassociated with the selected hard example to the reference ROI meets orexceeds a degree of alignment threshold. In some instances, suchdeterminations may be made by determining whether the ROI would havebeen suppressed under NMS. That is to say, that the NMS operation may beused to determine those examples which have high confidences and thatare associated with an ROI which corresponds to the reference ROI and toexclude them from what otherwise would be a hard example.

In some instances, operation 608(c)(2) may suppress selection of hardexamples for portions of the image within the reference ROI and thatproduce ROIs that have “good” degrees of alignment. For example, ROIs400′ and 404′ are examples that, if chosen as hard examples, may besuppressed at operation 608(c)(2) since they were produced from portionsof the image within the reference ROI 500 and they are each associatedwith degrees of alignment that exceeds a threshold degree of alignment,indicating a “good” fit of the ROIs to the reference ROI 500.

In at least some instances, as opposed to suppressing (e.g., discarding)such examples, such examples may be reassigned as positive examples. Insome instances, determining to suppress a hard example may includealtering a target confidence score associated with the hard example. Forexample, ROIs produced for portions of the image within the central 30%of a reference ROI may be associated with a maximum target confidencescore (e.g., 1.0) based on the determination that they arerepresentative of ground truth. However, when a hard example issuppressed, the target confidence score associated with that hardexample and used to train using the hard example may be modified. Forexample, if a hard example was selected that is determined to besuppressed, the target confidence score for that hard example may bechanged to 1.0. Training may then be conducted using the suppressed hardexample and the new target confidence score, 1.0. In other words, theselected hard negative example may be, instead, reassigned as a positiveexample, thereby backpropagating loss. If the selected hard example isnot suppressed (i.e., the example is a true hard negative), theconfidence loss may be set to 0 such that the example is trained tooutput any box, but having a correspondingly low confidence value.

In at least some examples which implement a 30% central region as groundtruth, these techniques improve the accuracy of the ML model overtechniques that merely disregard examples generated from a remaining 70%of the reference ROI (e.g., that portion of the object which is not partof a central 30%) which are naively selected based on ranking alone.These techniques also improve the accuracy of the ML model overtechniques that train the ML model by penalizing examples producedoutside the central 30%, since the portions of the image outside thecentral 30% and within the reference ROI may produce ROIs of an adequatedegree of alignment—in other words, penalizing such portions forproducing adequate ROIs may teach the ML model to learn a distinctionthat does not exist in reality (e.g., the portion for which an adequateROI was produced does in fact correlate to the representation of anobject in the image, and penalizing this teaches the ML model to make adistinction that doesn't exist in reality).

At operation 610, the example process 600 may include training the MLmodel using the selected subset of examples, according to any of thetechniques discussed herein.

In at least some instances, training the ML model may include at leasttwo stages, where the first stage may omit such NMS reassignment and asecond stage that follows the first stage may include NMS reassignment.In such examples, during the second stage, ROIs of various portions ofthe image (cells) may be suppressed under NMS, such that non-suppressedROIs may be used as the reference ROIs 500 for training the ML model inthe same or a subsequent stage.

In some instances, the first stage may include providing a first batchof images to the ML model for training, and the second stage may includeproviding a second batch of images to the ML model for training. That isto say, different batches of data may be used to subsequently train themodel.

In some instances, training the ML model in the second stage mayincorporate a focal loss function. In some instances, the focal lossfunction may include a cross entropy loss function that adds a factor,(1−p_(t))^(γ), where γ is >0 (e.g., γ=1, γ=2, γ=5) to more heavilypenalize hard, misclassified examples than well-classified examples(e.g., those examples where p_(t)>0.5 or p_(t)>0.7). For example, thefocal loss function may be evaluated for ROIs using the followingequation:FL(p _(t))=−(1−p _(t))^(γ) log(p _(t))where:

$p_{t} = \{ \begin{matrix}{p,} & {{{if}\mspace{14mu} y} = 1} \\{{1 - p},} & {otherwise}\end{matrix} $and y∈{±1} denotes the ground-truth class and p∈[0,1] is the ML model'sconfidence score for the class with label y=1. Functionally, thisdownweights the error calculated by the cross entropy loss function forROIs that are associated with a low error (e.g., for p_(t)>0.5,confidence score is close to the optimal score, ROI fits the groundtruth well) and progressively penalizes larger errors. Simply, the moreconfident the ML model was about an ROI it produced that was actuallyincorrect, the more the cross entropy loss is left unchanged by thefocal loss function. Whereas, the focal loss function downweights theerror calculated for a well-classified example so that, even if thereare many well-classified examples, the effect of the minimal errors eachproduces will have less of an effect training. In some instances, theloss function of operation 608 may include a cross entropy lossfunction, a Huber function, a mean-squared error calculation, etc.

In some instances, three stages are contemplated wherein the first stageomits any focal loss and NMS reassignment, whereas the second and thirdstages incorporate focal loss and/or NMS reassignment. In at least someinstances, images may be scaled differently at one or more of thestages. As a non-limiting example, cropped images of size 240×240 may beused in the first batch when training in the first stage, whereas imagecrops having size 960×600 may be used in a third batch used to train themodel in a third stage. In general, an image crop size, a number ofiterations, learning rate, batch size, and/or balancing may vary fromstage to stage.

In some instances, the first batch of images and/or the second batch ofimages may be data balanced to ensure that the ML model is being trainedto accurately detect objects of different types. ML models that arecontinuously exposed to one object classification may slowly “forget”(e.g., become less accurate in detecting) objects of a different type towhich they are exposed less frequently. Furthermore, where few examplesexist in a dataset of one particular class (e.g., if cars heavilydominate a dataset with respect to bicycles), the ML model may optimizelosses by simply stating that there are no bicycles in any image.Therefore, in some instances, the first batch of images and/or thesecond batch of images may include a first predefined number of imagesthat are associated with a first object classification (e.g., each ofthe first predefined number of images include at least one pedestrian)and a second predefined number of images that are associated with asecond object classification (e.g., each of the second predefined numberof images include at least one biker), though any number of classes andrelative weights are contemplated. For example, an input batch mayinclude 32 images, which may include at 4 of each type of object the MLmodel is trained to detect, e.g., 4 bikes, 4 cars, 4 pedestrians, 4night images, 4 day images, etc. In some instances, training the MLmodel may include receiving an image, determining an objectclassification associated with the image, and associating the image witha training queue that is associated with the object classification. Attraining time, the batches may be composed from outputs of multiplequeues, where each queue is associated with a different objectclassification and/or image condition (e.g., night/day, obstruction). Byensuring that the ML model is continuously training on a variety ofobject classifications, the ML model is less likely to “forget” anobject classification.

Example Response Curves & Restricted Multi-Scale Inference

FIGS. 7A and 7B illustrate an example of suppressing ROI output sizesbased on scale. Generally, neural networks may be associated with areceptive field. Such a receptive field may be indicative of how muchdata of an input signal is used when making an inference. If, forexample, the receptive field of a model is not large enough, largersized objects may not be adequately determined using the model. Asabove, though a larger model may be employed to detect all objects, sucha model would require significant resources and processing, which limitstheir application (e.g., such a model would not be able to be used in anautonomous vehicle application due to the processing time and memoryrequirements). To resolve these limitations, one or more smallernetworks may be employed (i.e., a network having a smaller memoryfootprint and/or processing requirements). Each such network may beassociated with a particular accuracy for various ROI sizes andconstrained to only output ROIs within such a range. Though discussed inthe context of sizes, any data stratification (or other metric) iscontemplated herein. As non-limiting examples, such techniquesillustrated in any of FIGS. 7-8 may further select optimal networks forany one or more of sizes of regions of interest, local contrast, or thelike.

As illustrated in FIG. 7A, a first graph 700 including an exampleresponse curve 702 of a first ML model to objects having various sizeswithin image(s) of a first scale. FIG. 7B illustrates a second graph 704including a second example response curve 706 of a second ML model toobjects having various sizes within image(s) of a second scale. They-axis of the first graph 700 and the second graph 704 may indicate anaccuracy of the model with respect to an ROI and/or confidence score toidentify an object in an image and the x-axis of the first graph 700 andthe second graph 704 may indicate a size of the object in the image, asize of the ROI, and/or a size of the image. In one example, the x-axismay indicate the size of the ROI.

In some instances, the techniques may include determining a responsecurve associated with a first ML model that indicates the accuracy ofthe first ML model to classify (e.g., produce an ROI and/or confidencescore for) an object over apparent object size in an image. To producethis response curve, the techniques may include providing, as input tothe first ML model, a plurality of objects (represented in one or moreimages); receiving, as output from the first ML model, a plurality ofROIs and/or confidence scores associated with the plurality of objects;and determining an accuracy for each of the ROIs and/or confidencescores (e.g., by comparing to a ground truth, by computing a degree ofalignment for each ROI to a respective ground truth area. To produce theresponse curve, the techniques may include associating a size of an ROI(e.g., a height and/or width, an area) with the accuracy of the ROI(e.g., a degree of alignment associated with the ROI, a disparitybetween the degree of alignment and the confidence score). Theseaccuracy/ROI size pairs may be amalgamated for the ROIs determined forthe first ML model from a batch of images.

In some instances, a batch of thousands or, even, hundreds of thousandsof images may be provided, as input, to the first ML model so that thisresponse curve may be determined. Once the first ML model has processedthe batch, the techniques may include identifying a range of ROI sizesassociated with accuracies that meet or exceed a threshold accuracy, andassociating the range of sizes with the first ML model. This range ofsizes may indicate that the first ML model determines “good” ROIs forobjects in that range of sizes. In some instances, the first ML modelmay output ROIs that have sizes within the size range and may suppressother ROIs determined by the first ML model. In some instances,additionally or alternatively to plotting accuracy over ROI size, theaccuracy of ROIs may be plotted over ground truth size, image portionsize, and/or image size.

For example, the threshold accuracy may be indicated by 708, the firstML model may be associated with response curve 702, and a second MLmodel may be associated with response curve 706, similarly generatedaccording to the techniques discussed above. In at least some instances,the first and second ML models may be the same model, only differing inthe input scale. According to the depicted example, a first rangeassociated with the first ML model may only output ROIs having a pixelheight between 100 and 200 pixels based on an input image of size900×900, whereas a second range associated with the second ML model mayonly output ROIs having a height between 50 and 100 pixels based on aninput image of size 300×300. In some instances, the first response cure702 and the second response curve can be associated with differentthreshold accuracy levels.

Of course, any number of models and/or scales may be determined forvarious ranges of input and output sizes. Images of various scales(greater than, equal to, or less than the original image size) may beinput to various models (either sequentially or substantiallysimultaneously) to detect, classify, and/or segment objects in theimages.

In at least one example, designation of the model, ranges, orstratification to be selected may be determined, based at least in part,on a tertiary model. As a non-limiting example, a model may be trainedto discriminate between what scale and/or what model to use fordetermining the desired output.

FIG. 8A illustrates a first scaled image 800 provided, as input, to afirst ML model 802, a first scaled image and two ROIs (804 & 806)generated by the first ML model responsive to receiving the first scaledimage, according to the techniques discussed herein. In some instances,the first ML model 802 may be associated with a first range of sizes andmay have generated an ROI for vehicle 108, but the ROI may have fallenoutside the first range of sizes and been suppressed by the first MLmodel. Whereas ROI 804, corresponding to vehicle 106, and ROI 806,corresponding to vehicle 110, may fall within the first range of sizesand may therefore be output by the first ML model. In some instances,the first scaled image may be scaled by a factor of 1 (e.g., the firstscaled image is unscaled).

FIG. 8B illustrates an example second scaled image 808 provided, asinput, to the first ML model, and an ROI 810 generated by the first MLmodel responsive to receiving the second scaled image, according totechniques discussed herein. In some instances, the second scaled imageis scaled by a scale coefficient that is less than 1, resulting in animage of a smaller scale than that of example image 800. In the depictedexample, since the image has been scaled down, the ROI corresponding tovehicle 108 now falls within the first range of sizes associated withthe first ML model and the ROIs associated with vehicles 106 and 110have fallen outside the first range of sizes and are thereforesuppressed by the first ML model 802 in FIG. 8B. In some instances, thesecond scale factor (and/or any additional scale factors) may be chosensuch that ROIs will not be redundantly produced for a same object when asame image is provided to the first ML model at two different scales.

In some instances, the first range of sizes may be based at least inpart on a receptive field of the first ML model. For example, therepresentation of vehicle 108 in example image 800 may be too large tofit the receptive field, but the representation of vehicle 108 inexample image 808, once scaled down, may fit into the receptive field ofthe first ML model.

In some instances, the first range of sizes and/or the second range ofsizes can be based in part on a regression model (or other machinelearned model) to optimize the precision, recall, and/or accuracy of thevarious ML models used to differentiate between various sizes (orbetween various metrics and/or data stratifications, discussed below).

FIG. 8C illustrates an additional or alternate instance for detectingall the objects in an image. Instead of iteratively providing an imageto an ML model, determining ROIs, and outputting ROI(s) having size(s)within a first range of sizes, scaling the image, providing the scaledimage to the ML model, and so on (as depicted in FIG. 8B), the exampleimage 800 may be provided to a second ML model 812 associated with asecond range of sizes so that the second ML model 812 may determine anROI 814 for the object that isn't detected by the first ML model (e.g.,vehicle 108 in this example). In some instances, an image may beprovided to multiple detectors, where each detector is associated with adifferent range of sizes and outputs ROIs within that range of sizes;and/or this technique may be combined with providing a first scaledimage to a first detector, receiving a first output from the firstdetector, scaling the first scaled image as a second scaled image,providing the second scaled image to the first detector, and receiving asecond output from the second detector.

Although FIGS. 8A, 8B, and 8C are discussed in the context of varying asize of input images and/or in the context of selecting a ML model basedon expected output sizes, any metric and/or data stratification can beused to select the appropriate ML models and/or input scales. Forexample, various metrics can include, but are not limited to, one ormore of contrast (e.g., local contrast of regions and/or pixels of animage), brightness, number of channels, color (e.g., RGB, black andwhite, grayscale, etc.), size (e.g., width and height), area, a size ofa grid, a number of objects identified in an image, time of day (e.g.,day/night), weather (e.g., rain, sun, snow, fog, etc.), classification,and the like.

In this manner, a same ML model and/or different ML models may produceROIs for objects of different sizes at a high degree of accuracy andwithout training a large neural network that would take too much computetime to be useful for real-time applications, such as controlling anautonomous vehicle.

Example Instance Segmentation

FIG. 9A illustrates an example ROI 900 determined by an ML model for aportion 902 of an example image 904. As with the examples illustratedabove (e.g., with respect to FIG. 5 ) an ML model may be trained tooutput ROIs. However, unlike the models trained in the above examples,the ML model illustrated in FIG. 9A may be trained, instead of usingROIs associated with a central 30%, but those ROIs associated withpixels in a mask of an object. Specifically, an image mask and acorresponding ROI for an object in an image may be used as ground truthwhen training the ML model. Such a training region of interest may bedetermined, for example, based on an associated ROI with the mask (e.g.,a bounding box based at least in part on the pixels of the mask). Asillustrated in FIG. 9A, a portion 902 (which may be a pixel) of theimage 904 may form part of a mask of an object and have an associatedROI 900.

FIG. 9B illustrates an example plurality of ROIs 906 associated with asame object in the example image 904 (i.e., vehicle 110 in thisexample). In some instances, the ML model may receive the example image904 and may produce multiple ROIs, including the example plurality ofROIs 906 and/or confidence scores associated therewith for every portionand/or pixel of the image 904.

In some instances, as above, the ML model may determine a single ROI tobe associated with the object (e.g., object 110) out of the plurality ofROIs determined. In at least one example, such a detection may beaccomplished using NMS. Similar to examples discussed herein, everypixel or portion may output an ROI and the plurality of ROIs may besuppressed with NMS (e.g., those ROIs that are not associated with amaximum confidence level may be suppressed). The ML model maysubstantially simultaneously determine an ROI to associate with vehicle110 and a mask that identifies particular portions of the image that areassociated with the object (e.g., pixels that represent the object)based at least in part on the determination of the ROI for output.

In at least one instance, such an ML model may retain an indication ofthe pixels and/or regions which were suppressed during the NMS. All suchpixels and/or portions of the image may be associated with a mask(instance segmentation) of the object. In some instances, the portion ofthe image that produced the maximal ROI that was not suppressed by NMSmay also be associated with the mask.

FIG. 9C illustrates two representations (910 & 912) of an exampleinstance segmentation (i.e., a mask in the depicted example) identifyingan object, according techniques discussed herein. Representation 910includes darkened portions of the image that the example mask identifiesas representing the object (i.e., vehicle 110). For the sake of clarity,representation 912 is included in FIG. 9C to show that the portions ofthe image included in the mask as positively identifying an objectcorrespond to the vehicle 110. In some instances, each of the darkenedportions of the image of representation 910 may correspond to a portionof the image for which the ML model generated an ROI that was suppressedduring NMS, or otherwise associated with an ROI of such an object (e.g.,the ROI associated with the maximum confidence score). In someinstances, the autonomous vehicle may use the ROI and/or the mask togenerate a trajectory for controlling motion of the autonomous vehicle.

This technique is an improvement over former techniques that require aseparate operation to perform instance segment. Instead, the techniquesdiscussed herein perform both object detection and image segmentation inthe same compute time it takes to perform the object detection usingconventional techniques. In some instances, the ML model describedherein runs in 20 milliseconds.

Example Architecture

FIG. 10 is a block diagram of an example architecture 1000 including anexample vehicle system 1002 for controlling operation of at least onevehicle, such as an autonomous vehicle, according to any of thetechniques discussed herein. In some instances, the vehicle system 1002may represent at least a portion of autonomous vehicle 104. In someinstances, this architecture may be used to control an autonomousvehicle, based at least in part on the ROIs, image segments, and/orconfidence scores discussed herein.

In some instances, the vehicle system 1002 may include processor(s) 1004and/or memory 1006 (which may collectively represent computing device(s)118). These elements are illustrated in combination in FIG. 10 ,although it is understood that they may be separate elements of thevehicle system 1002, and that components of the system may beimplemented as hardware and/or software, In some instances.

Processor(s) 1004 may include a uniprocessor system including oneprocessor, or a multiprocessor system including several processors(e.g., two, four, eight, or another suitable number). The processor(s)1004 may be any suitable processor capable of executing instructions.For example, in various implementations, the processor(s) may begeneral-purpose or embedded processors implementing any of a variety ofinstruction set architectures (ISAs), such as the x86, PowerPC, SPARC,or MIPS ISAs, or any other suitable ISA. In multiprocessor systems, eachprocessor 1004 may commonly, but not necessarily, implement the sameISA. In some instances, the processor(s) 1004 may include a centralprocessing unit (CPU), a graphics processing unit (GPU), FieldProgrammable Gate Arrays (FPGA), Application Specific Integrated Circuit(ASIC), or a combination thereof.

The example vehicle system 1002 may include memory 1006. In someinstances, the memory 1006 may include a non-transitory computerreadable media configured to store executable instructions/modules,data, and/or data items accessible by the processor(s) 1004. In variousimplementations, the non-transitory computer readable media may beimplemented using any suitable memory technology, such as static randomaccess memory (SRAM), synchronous dynamic RAM (SDRAM),nonvolatile/Flash-type memory, or any other type of memory. In theillustrated example, program instructions and data implementing desiredoperations, such as those described above, are shown stored within thenon-transitory computer readable memory. In other implementations,program instructions, and/or data may be received, sent, or stored ondifferent types of computer-accessible media, such as non-transitorycomputer readable media, or on similar media separate from thenon-transitory computer readable media. Generally speaking, anon-transitory, computer readable memory may include storage media ormemory media, such as flash memory (e.g., solid state memory), magneticor optical media (e.g., a disk) coupled to the example vehicle system1002 via an input/output (“I/O”) interface 1008. Program instructionsand data stored via a non-transitory computer readable medium may betransmitted by transmission media or signals such as electrical,electromagnetic, or digital signals, which may be conveyed via acommunication medium such as a network and/or a wireless link, such asmay be implemented via a network interface 1010.

Furthermore, though illustrated as a single unit in FIG. 10 , it isunderstood that the processor(s) 1004 and memory 1006 may be distributedamong multiple computing devices of the vehicle and/or among multiplevehicles, data centers, teleoperation centers, etc.

In some instances, the input/output (“I/O”) interface 1008 may beconfigured to coordinate I/O traffic between the processor(s) 1004, thememory 1006, the network interface 1010, sensor(s) 1012, I/O devices1014, drive system 1016, and/or any other hardware of the vehicle system1002. In some instances, the I/O devices 1014 may include externaland/or internal speaker(s), display(s), passenger input device(s), etc.In some instances, the I/O interface 1008 may perform protocol, timing,or other data transformations to convert data signals from one component(e.g., the non-transitory computer readable media) into a formatsuitable for use by another component (e.g., processor(s)). In someinstances, the I/O interface 1008 may include support for devicesattached through various types of peripheral buses, such as thePeripheral Component Interconnect (PCI) bus standard, the UniversalSerial Bus (USB) standard, or a variant thereof, for example. In someimplementations, the function of the I/O interface 1008 may be splitinto two or more separate components, such as a north bridge and a southbridge, for example. Also, in some instances, some or all of thefunctionality of the I/O interface 1008, such as an interface to thememory 1006, may be incorporated directly into the processor(s) 1004and/or one or more other components of the vehicle system 1002.

The example vehicle system 1002 may include a network interface 1010configured to establish a communication link (i.e., “network”) betweenthe vehicle system 1002 and one or more other devices. For example, thenetwork interface 1010 may be configured to allow data to be exchangedbetween the vehicle system 1002 and another vehicle 1018 via a firstnetwork 1020, and/or between the vehicle system 1002 and a remotecomputing system 1022 via a second network 1024. For example, thenetwork interface 1010 may enable wireless communication between anothervehicle 1018 and/or the remote computing device 1022. In variousimplementations, the network interface 1010 may support communicationvia wireless general data networks, such as a Wi-Fi network, and/ortelecommunications networks, such as, for example, cellularcommunication networks, satellite networks, and the like.

The example vehicle system 1002 may include sensor(s) 1012, for example,configured to localize the vehicle system 1002 in an environment, todetect one or more objects in the environment, to sense movement of theexample vehicle system 1002 through its environment, sense environmentaldata (e.g., ambient temperature, pressure, and humidity), and/or senseconditions of an interior of the example vehicle system 1002 (e.g.,passenger count, interior temperature, noise level). The sensor(s) 1012may include, for example, one or more LIDAR sensors, one or more cameras(e.g., RGB-cameras, intensity (grayscale) cameras, infrared cameras,depth cameras, stereo cameras), one or more magnetometers, one or moreradar sensors, one or more sonar sensors, one or more microphones forsensing sounds, one or more IMU sensors (e.g., including accelerometersand gyroscopes), one or more GPS sensors, one or more Geiger countersensors, one or more wheel encoders, one or more drive system sensors, aspeed sensor, and/or other sensors related to the operation of theexample vehicle system 1002. In some instances, the sensor datadiscussed herein may be received at a first vehicle and transmitted to asecond vehicle. In some instances, the image discussed herein may bereceived at a sensor of the sensor(s) 1012 and provided to theperception engine 1026.

The example vehicle system 1002 may include a perception engine 1026(e.g., perception engine 116), an ML model 1028 (e.g., ML model 114),and a planner 1030 (e.g., planner 120).

The perception engine 1026 may include instructions stored on memory1006 that, when executed by the processor(s) 1004, configure theprocessor(s) 1004 to receive sensor data from the sensor(s) 1012 asinput, and output data representative of, for example, one or more ofthe pose (e.g., position and orientation) of an object in theenvironment surrounding the example vehicle system 1002, an object trackassociated with the object (e.g., a historic position, velocity,acceleration, and/or heading of the object over a period of time (e.g.,5 seconds)), and/or an object classification associated with the object(e.g., a pedestrian, a vehicle, a bicyclist, etc.). In some instances,perception engine 1026 may be configured to predict more than an objecttrajectory of one or more objects. For example, the perception engine1026 may be configured to predict multiple object trajectories based on,for example, probabilistic determinations or multi-modal distributionsof predicted positions, trajectories, and/or velocities associated withan object.

The perception engine 1026 may include instructions stored on memory1006 that, when executed by the processor(s) 1004, configure theprocessor(s) 1004 to receive sensor data from the sensor(s) 1012 asinput, such as an image; provide the sensor data to the ML model 1028;receive an ROI, an image segment, and/or a confidence score from the MLmodel 1028; and output an indication that the perception engine detectsan object from the sensor data and may output one or more ROIs, instancesegmentation(s), confidence score(s), classification(s), and/or otherdata related thereto. The ROI(s), the instance segmentation(s), theconfidence score(s), classification(s), and/or other data relatedthereto may also be stored in the memory 1006.

The ML model 1028 may include instructions stored on memory 1006 that,when executed by the processor(s) 1004, configure the processor(s) 1004to receive an image and determine, based at least in part on the image,to output ROI(s) and/or an instance segmentation(s) identifying arepresentation of an object in the image. The ML model 1028 may includea decision tree or any arrangement thereof, such as a random forestand/or boosted ensemble of decision trees; a directed acyclic graph(DAG) (e.g., where the nodes are organized as a Bayesian network); deeplearning algorithm(s), such as an artificial neural network (ANN), deepbelief network (DBN), deep stacking network (DSN), or recurrent neuralnetwork (RNN); etc. In some instances, the ML model 1028 may include anRNN having nodes through which feature values may be pushed to determinean output. For example, the ML model 1028 may include an input layer ofnodes, one or more hidden layer of nodes, and an output layer of nodes.In some instances, the input layer of nodes may be configured to receivethe image and/or a portion thereof and activate nodes of the one or morehidden layers. The output layer may be configured to receive stimulifrom nodes of the one or more hidden layers and to output an ROI, imagesegment, and/or confidence score based on nodes of the output layer thatare most activated and/or the output of an output node may correspond toan amount of activation of the output node. In some instances, anindividual output node may correspond with a portion of the image.

The perception engine 1026 may transmit the ROI, the image segment, theconfidence score, and/or other data related thereto to the planner 1030along with any other additional information that the planner 1030 mayuse to generate a trajectory (e.g., object classifications, objecttracks, vehicle pose). In some instances, the perception engine 1026and/or the planner 1030 may additionally or alternatively transmit theROI(s), the instance segmentation(s), the confidence score(s),classification(s), and/or other data related thereto via the networkinterface 1010 to the remote computing device 1022 via network 1024and/or another vehicle 1018 via network 1020, based, at least in part,on confidence score(s) determined by the perception engine 1026.

In some instances, the perception engine 1026 and/or the ML model 1028may be located at another vehicle 1018 and/or the remote computingdevice 1022. In some instances, a perception engine located at anothervehicle 1018 and/or remote computing device 1022 may coordinatedeterminations with the perception engine 1026. In some instances wherethe ML model 1028 is located at the other vehicle 1018 and/or remotecomputing device 1022, the other vehicle 1018 and/or remote computingdevice 1022 may receive the image from the vehicle system 1002 vianetworks 1020 and 1024, respectively, and may determine the ROI(s), theinstance segmentation(s), the confidence score(s), classification(s),and/or other data related thereto. The other vehicle 1018 and/or remotecomputing device 1022 may then transmit the ROI(s), the instancesegmentation(s), the confidence score(s), classification(s), and/orother data related thereto back to a planner 1030 of the vehicle system1002.

The planner 1030 may include instructions stored on memory 1006 that,when executed by the processor(s) 1004, configure the processor(s) 1004to generate data representative of a trajectory of the example vehiclesystem 1002, for example, using data representing a location of theexample vehicle system 1002 in its environment and other data, such aslocal pose data, and the ROI(s), the instance segmentation(s), theconfidence score(s), classification(s), and/or other data relatedthereto. In some instances, the planner 1030 may substantiallycontinuously (e.g., every 1 or 2 milliseconds, though any recedinghorizon time is contemplated) generate a plurality of potentialtrajectories with which to control the example vehicle system 1002 andselect one of the trajectories with which to control the vehicle. Theselection may be based at least in part on a current route, theprobability that the stationary vehicle is a blocking vehicle, currentvehicle trajectory, and/or detected object trajectory data. Uponselecting a trajectory, the planner 1030 may transmit the trajectory tothe drive system 1016 to control the example vehicle system 1002according to the selected trajectory.

In some instances, the perception engine 1026, the ML model 1028, and/orthe planner 1030 may further include specialized hardware such as, forexample, a processor that is suited to running the perception engine(e.g., a graphics processor, an FPGA).

Example Clauses

A. A system comprising: one or more processors; and one or morecomputer-readable media storing instructions executable by the one ormore processors, wherein the instructions, when executed, cause thesystem to perform operations comprising: providing, as input to amachine learning (ML) model, an image; receiving, as output from the MLmodel, a feature map, wherein a portion of the feature map is associatedwith a bounding box and a confidence score; and training the ML modelbased at least in part on a subset of examples, the training comprising:identifying a reference region associated with an area of the imagerepresenting an object; selecting a first hard example for inclusion inthe subset of examples, based at least in part on a first confidencescore associated with a first bounding box, the first confidence scoreand the first bounding box associated with a first portion of thefeature map; determining that a first degree of alignment of the firstbounding box to the reference region meets or exceeds a threshold degreeof alignment; and replacing, based at least in part on meeting orexceeding the threshold degree of alignment, the first hard example witha second hard example.

B. The system as paragraph A recites, the operations further comprising:including the second hard example in the subset of examples based atleast in part on determining that a second degree of alignment of asecond bounding box associated with the second hard example to thereference region is less than a threshold degree of alignment.

C. The system as paragraph A or B recites, wherein: a first portion ofthe reference region is indicated as being associated with a positiveexample; and the first portion of the feature map is associated with asecond portion of the reference region outside the first portion of thereference region.

D. The system as paragraph C recites, wherein: a first target confidencescore associated with the first portion of the reference region is amaximum confidence score; a second target confidence score associatedwith the second portion is a minimum confidence score; and training theML model further comprises: associating the first hard example with thefirst target confidence score instead of the second target confidencescore, based at least in part on the first degree of alignment meetingor exceeding the threshold degree of alignment.

E. The system as any of paragraphs A-D recites, wherein the first degreeof alignment is an intersection of the first bounding box with thereference region divided by a union of the first bounding box and thearea.

F. A computer-implemented method comprising: receiving an imagerepresenting an object; identifying a reference region indicative of anarea representing the object in the image; selecting a subset ofportions of the image; and training, based at least in part on thesubset, a machine-learning (ML) model to output a feature map, a portionof the feature map associated with classification information, region ofinterest (ROI) information, and confidence information, whereinselecting the subset of portions of the image comprises: identifying afirst portion of the feature map based at least in part on the firstportion having first confidence information that meets or exceeds athreshold confidence; comparing, as a comparison, ROI informationassociated with the first portion with the reference region; anddetermining, as the subset of portions of the image and based at leastin part on the comparison, a second portion of the feature map.

G. The computer-implemented method as paragraph F recites, wherein:comparing the ROI comprises performing a non-maximal suppression (NMS)of the ROI information of the first portion with respect to thereference region; and the second portion of the feature map isassociated with an ROI suppressed under non-maximal suppression.

H. The computer-implemented method as paragraph G recites, furthercomprising: associating, with the first portion, a highest confidencescore.

I. The computer-implemented method as any of paragraphs F-H recites,further comprising: training the ML model to substantiallysimultaneously output multiple output ROIs corresponding toclassifications based at least in part on the image, the classificationscomprising one or more of a vehicle, a pedestrian, or a bicyclist.

J. The computer-implemented method as any of paragraphs F-I recites,wherein: the reference region comprises a first region and a secondregion, and further wherein the second portion of the feature mapcomprises features outside of the first region.

K. The computer-implemented method as paragraph J recites, wherein thefirst region is associated with: a central portion of the referenceregion; and a positive identification of classification information.

L. The computer-implemented method as any of paragraphs F-K recites,wherein comparing comprises determining an amount of alignment as anintersection of the ROI information with the area indicated by thereference region divided by a union of the ROI information and thereference region.

M. The computer-implemented method as paragraph L recites, whereincomparing further comprises determining the amount of alignment meets orexceeds a threshold degree of alignment.

N. The computer-implemented method as any of paragraphs F-M recites,wherein training the ML model comprises at least two stages, wherein: afirst stage of the at least two stages comprises: providing, as firstinput to the ML model, a first batch of images; receiving, from the MLmodel and based at least in part on the first batch of images, anintermediate ROI associated with a first image of the first batch ofimages; identifying, as the reference region, the intermediate ROI; anda second stage of the at least two stages comprises: providing, assecond input to the ML model, the first batch of images; receiving fromthe ML model and based at least in part on the first batch of images, asecond plurality of ROIs and a second plurality of confidence scoresassociated therewith; selecting, for inclusion in a second subset ofexamples for training the ML model and based at least in part on anon-maximal suppression (NMS) technique, a hard example for training theML model from among portions of the image associated with the secondplurality of ROIs; and training the ML model based at least in part onthe second subset.

O. The computer-implemented method as paragraph N recites, wherein thesecond stage further comprises training the ML model using focal loss.

P. The computer-implemented method as any of paragraphs F-O recites,wherein the ROI information comprises a bounding box.

Q. The computer-implemented method as any of paragraphs F-P recites,further comprising: receiving a batch of images comprising a firstpredefined number of images that are associated with a first objectclassification and a second predefined number of images that areassociated with a second object classification; and training the MLmodel based at least in part on providing the batch of images as inputto the ML model, wherein the first predefined number of images and thesecond predefined number of images are based at least in part onconfidence information associated with one or more features of thefeature map.

R. A non-transitory computer-readable medium having a set ofinstructions that, when executed, cause one or more processors toperform operations comprising: providing, as input to a machine-learning(ML) model, an image; receiving, as output from the ML model, a featuremap, a first portion of the feature map comprising a first region ofinterest (ROI) indicative of an object in the image and a firstconfidence score; and training the ML model based at least in part on asubset of positive examples and a subset of negative examples associatedwith a plurality of portions of a test image, wherein training the MLmodel comprises: providing the test image to the ML model, the testimage representing an object corresponding to a ground truth referenceregion; determining, as a hard negative example, a second portion of thefeature map having a second confidence score that meets or exceeds athreshold confidence score; determining that the hard negative exampleis associated with a second ROI that is suppressed under a non-maximalsuppression technique; and excluding, from the subset of negativeexamples, the hard negative example.

S. The non-transitory computer-readable medium as paragraph R recites,wherein: the first ROI of the first portion comprises a bounding box;and the first confidence score of the first portion indicates aprobability that the first ROI accurately represents a region of theimage that represents the object.

T. The non-transitory computer-readable medium as paragraph R or Srecites, wherein the first portion of the feature map is associated witha plurality of ROIs, an ROI of the plurality of ROIs corresponding to aplurality of classifications, the classifications comprising one or moreof a vehicle, a bicycle, or a pedestrian.

U. A system comprising: one or more processors; and one or morecomputer-readable media storing instructions executable by the one ormore processors, wherein the instructions, when executed, cause thesystem to perform operations comprising: receiving an image having afirst scale; providing the image to a first machine-learning (ML) model;receiving, from the first ML model, a first bounding box indicative of afirst region of the image representing at least part of a first object,the first bounding box having a first size within a first range ofsizes; scaling, based at least in part on a second scale, the image as ascaled image; providing the scaled image to a second ML model; andreceiving, from the second ML model, a second bounding box indicative ofa second region of the image representing at least part of a secondobject, the second bounding box having a second size within a secondrange of sizes.

V. The system as paragraph U recites, wherein the image is provided tothe first ML model and the scaled image is provided to the second MLmodel substantially simultaneously.

W. The system as paragraph U or V recites, wherein the first ML modeland the second ML model are a same ML model.

X. The system as any of paragraphs U-W recites, the operations furthercomprising: determining the first range of sizes for the ML model basedat least in part on: providing, as input to the ML model, a first batchof training images that include objects of different sizes; determining,based at least in part on ground truths associated with the objects,accuracies of the ML model as a function of ROI sizes; and determiningthe first range of sizes based at least in part on identifying a rangeof ROI sizes that correspond to accuracies that meet or exceed athreshold accuracy.

Y. A computer-implemented method comprising: receiving a first scaledimage and a second scaled image, the first scaled image and the secondscaled image corresponding to an image; providing, as first input to afirst machine-learning (ML) model, the first scaled image; receiving, asfirst output from the first ML model, one or more first regions ofinterest (ROIs) having sizes within a first range of sizes; providing,as second input to a second ML model, the second scaled image; andreceiving, as second output from the second ML model, one or more secondROIs having sizes within a second range of sizes.

Z. The computer-implemented method as paragraph Y recites, wherein: theimage includes representations of a first object and a second object,and the computer-implemented method further comprises: determining, bythe first ML model and based at least in part on the first scaled image,a first ROI that represents the first object and a second ROI thatrepresents the second object; and determining, by the second ML modeland based at least in part on the second scaled image, a third ROI thatrepresents the first object and a fourth ROI that represents the secondobject.

AA. The computer-implemented method as paragraph Z recites, wherein: thefirst ROI has a first size outside the first range of sizes; the secondROI has a second size within the first range of sizes; the third ROI hasa third size outside the second range of sizes; the fourth ROI has afourth size within the second range of sizes; the first ML modeldiscards the first ROI and outputs the second ROI; and the second MLmodel discards the fourth ROI and outputs the third ROI.

AB. The computer-implemented method as any of paragraphs Y-AA recites,further comprising: scaling, based at least in part on a first scale,the image to generate the first scaled image; and scaling, based atleast in part on a second scale, the image to generate the second scaledimage.

AC. The computer-implemented method as any of paragraphs Y-AB recites,wherein the first scaled image is provided to the first ML model and thesecond scaled image is provided to the second ML model substantiallysimultaneously.

AD. The computer-implemented method as any of paragraphs Y-AC recites,further comprising determining the first range of sizes based at leastin part on an accuracy associated with a first ROI of the one or morefirst ROIs, the determining comprising: determining, based at least inpart on a ground truth associated with an area of the image representingan object, a degree of alignment of the first ROI to the area defined bythe ground truth; and determining the first range of sizes based atleast in part on identifying a range of ROI sizes that corresponds todegrees of alignment determined for the one or more first ROIs that meetor exceed a threshold degree of alignment.

AE. The computer-implemented method as any of paragraphs Y-AD recites,further comprising: receiving a batch of images, wherein the batch ofimages includes a first predefined number of images that are associatedwith a first object classification and a second predefined number ofimages that are associated with a second object classification; andtraining the first ML model based at least in part on providing thebatch of images as input to the first ML model, wherein the firstpredefined number of images and the second predefined number of imagesas based at least in part on a confidence score associated with thefirst ML model or the second ML model.

AF. A non-transitory computer-readable medium having a set ofinstructions that, when executed, cause one or more processors toperform operations comprising: providing, as input to a firstmachine-learning (ML) model associated with a first size range, animage; determining, by the first ML model and based at least in part onthe image, a first plurality of regions of interest (ROIs); suppressinga first output of a first subset of ROIs of the first plurality of ROIs,wherein suppressing the first output of the first subset of ROIscomprises determining that the first subset of ROIs is associated withfirst sizes that are outside the first size range; and receiving, as asecond output from the first ML model, one or more first ROIs associatedwith an object or a first indication that a dimension of the object isoutside the first size range.

AG. The non-transitory computer-readable medium as paragraph AF recites,wherein receiving the first indication that the dimension of the objectis outside the first size range is based at least in part on determiningthat the first subset of ROIs includes all of the first plurality ofROIs.

AH. The non-transitory computer-readable medium as paragraph AF or AGrecites, wherein the operations further comprise: providing, as input toa second ML model associated with a second size range, the image,wherein providing the image to the second ML model occurs substantiallysimultaneously as providing the image to the first ML model;determining, by the second ML model, a second plurality of ROIs;suppressing a third output of a second subset of ROIs of the secondplurality of ROIs, wherein suppressing the second subset of ROIscomprises determining that at least a portion of ROIs of the secondsubset of ROIs is associated with second sizes that are outside thesecond size range; and receiving, from the second ML model, one or moresecond ROIs associated with the object or a second indication that thedimension of the object is outside the second size range.

AI. The non-transitory computer-readable medium as paragraph AH recites,wherein an ROI corresponding to the object is received from the first MLmodel or the second ML model, based at least in part on the dimension ofthe object in the image, the first size range, and the second sizerange.

AJ. The non-transitory computer-readable medium as paragraph AH or AIrecites, wherein: the first ML model outputs the one or more first ROIshaving sizes within the first size range, based at least in part on afirst accuracy of the first ML model associated with the first sizerange; and the second ML model outputs the one or more second ROIshaving sizes within the second size range, based at least in part on asecond accuracy of the second ML model associated with the second sizerange.

AK. The non-transitory computer-readable medium as any of paragraphsAH-AJ recites, wherein the operations further comprise: generating,based at least in part on the one or more first ROIs or the one or moresecond ROIs, a trajectory for controlling motion of an autonomousvehicle.

AL. The non-transitory computer-readable medium as any of paragraphsAH-AK recites, wherein the operations further comprise: selecting thefirst size range and the second size range based at least in part on amachine learned model.

AM. The non-transitory computer-readable medium as any of paragraphsAF-AL recites, wherein the operations further comprise determining thefirst size range for the first ML model based at least in part on:training the first ML model, wherein the training comprises: providing,as input to the first ML model, test images that include test objectsassociated with areas defined by reference regions; and determining, bythe first ML model and based at least in part on the test images,multiple ROIs; determining degrees of alignment of the multiple ROIs toan area of the areas defined by the reference regions; and determiningthe first size range based at least in part on identifying a span ofobject sizes that corresponds to a portion of the degrees of alignmentthat meet or exceed a threshold degree of alignment.

AN. The non-transitory computer-readable medium as any of paragraphsAF-AM recites, wherein the operations further comprise: receiving abatch of images, wherein the batch of images comprises a firstpredefined number of images that are associated with a first objectclassification and a second predefined number of images that areassociated with a second object classification; and training the firstML model based at least in part on providing the batch of images asinput to the first ML model, wherein the first predefined number and thesecond predefined number are based at least in part on a confidencescore associated with the first ML model or a second ML model.

AO. A computer-implemented method comprising: providing, as input to amachine-learning (ML) model, an image; receiving, as output from the MLmodel, a feature map comprising a plurality of features, a feature ofthe plurality of features comprising a confidence score, classificationinformation, and a region of interest (ROI) determined in accordancewith a non-maximal suppression (NMS) technique; and associating, usingan instance segmentation, a subset of features having similar ROIs.

AP. The computer-implemented method as paragraph AO recites, wherein thesubset of features having the similar ROIs comprises features which areindicated as being suppressed via the NMS technique.

AQ. The computer-implemented method as paragraph AP recites, whereindetermining to output a first ROI associated with a first featurecomprises: determining that the first ROI is associated with a maximumconfidence score of a subset of confidence scores associated with thesubset of features; and outputting the first ROI to associate a regionof the image as representing an object.

AR. The computer-implemented method as any of paragraphs AO-AQ recites,further comprising outputting a mask corresponding to the instancesegmentation to identify pixels of the image as representing an object.

AS. The computer-implemented method as paragraph AR recites, furthercomprising generating, based at least in part on at least one of an ROIoutput by the ML model or the instance segmentation, a trajectory forcontrolling motion of an autonomous vehicle.

AT. The computer-implemented method as any of paragraphs AO-AS recites,further comprising training the ML model based at least in part on atest image and a ground truth associated therewith, wherein the groundtruth identifies a mask.

AU. The computer-implemented method as any of paragraphs AO-AT recites,further comprising training the ML model to substantially simultaneouslyoutput multiple ROIs for each feature corresponding to multipleclassifications, the multiple classifications comprising one or more ofa vehicle, a pedestrian, or a bicycle.

AV. The computer-implemented method as any of paragraphs AO-AU recites,wherein the ROI is a bounding box.

AW. A system comprising: one or more processors; and one or morecomputer-readable media storing instructions executable by the one ormore processors, wherein the instructions, when executed, cause thesystem to perform operations comprising: providing, as input to amachine-learning (ML) model, an image; determining, by the ML, a featuremap comprising a plurality of features, a feature of the plurality offeatures comprising a region of interest (ROI), an identification, and aconfidence score; and outputting, as an instance segmentation, an outputimage based at least in part on identifications associated with theplurality of features.

AX. The system as paragraph AW recites, wherein the ROI of the featureis determined in accordance with a non-maximal suppression (NMS)technique, the NMS technique comprising: determining that the confidencescore associated with the feature meets or exceeds a thresholdconfidence score; determining that the ROI is associated with a degreeof alignment to a corresponding ROI of a corresponding feature thatmeets or exceeds a threshold degree of alignment; determining, as theROI, the corresponding ROI; and determining, as the identification, acorresponding identification of the corresponding feature.

AY. The system as paragraph AW or AX recites, wherein the operationsfurther comprise outputting the instance segmentation as a mask thatidentifies pixels of the image as representing an object associated withan object classification.

AZ. The system as paragraph AY recited, the operations furthercomprising: determining, based at least in part on the mask, atrajectory configured to cause an autonomous vehicle to traverse aportion of an environment; and providing the trajectory to theautonomous vehicle.

BA. The system as any of paragraphs AW-AZ recites, the operationsfurther comprising: training the ML model based at least in part onproviding, as input to the ML model and substantially simultaneously, abatch of images that includes a first predefined number of images thatare associated with a first object classification and a secondpredefined number of images that are associated with a second objectclassification, wherein the first predefined number and the secondpredefined number are determined based at least in part on one or moreconfidence scores associated with the plurality of features.

BB. The system as any of paragraphs AW-BA recites, the operationsfurther comprising: training the ML model based at least in part on atest image and a ground truth associated therewith, wherein the groundtruth identifies a reference region and a mask.

BC. A non-transitory computer-readable medium having a set ofinstructions that, when executed, cause one or more processors toperform operations comprising: receiving, at a machine-learning (ML)model, an image; determining, by the ML model, a feature map comprisinga plurality of features, a feature of the plurality of featurescomprising a region of interest (ROI) and an identification, the ROIindicative of one or more objects in the image; and outputting, as aninstance segmentation, identifications associated with the plurality offeatures, wherein an identification of the identifications isdetermined, based at least in part, on the ROI of the feature and anon-maximal suppression (NMS) technique.

BD. The non-transitory computer-readable medium as paragraph BC recites,wherein the identification is further determined based on whether theROI of the feature is suppressed under the NMS technique based on acorresponding ROI of a corresponding feature, the feature and thecorresponding feature having the same identification.

BE. The non-transitory computer-readable medium as paragraph BC or BDrecites, wherein the ROI is a bounding box having an extent and a centerposition.

BF. The non-transitory computer-readable medium as any of paragraphsBC-BE recites, wherein the feature map has dimensions that are afraction of dimensions of the image.

BG. The non-transitory computer-readable medium as any of paragraphsBC-BF recites, the operations further comprising: training the ML modelbased at least in part on a test image and a ground truth associatedtherewith, wherein the ground truth identifies a reference region and amask.

BH. The non-transitory computer-readable medium as paragraph BG recites,wherein the training the ML model comprises providing, as input to theML model, a batch of images that comprises a first predefined number ofimages that are associated with a first object classification and asecond predefined number of images that are associated with a secondobject classification, wherein the first predefined number and thesecond predefined number are based at least in part on one moreconfidence levels of the plurality of features.

While the example clauses described above are described with respect toone particular implementation, it should be understood that, in thecontext of this document, the content of the example clauses can also beimplemented via a method, device, system, a computer-readable medium,and/or another implementation.

Although the subject matter has been described in language specific tostructural features and/or methodological acts, it is to be understoodthat the subject matter defined in the appended claims is notnecessarily limited to the specific features or acts described. Rather,the specific features and acts are disclosed as example forms ofimplementing the claims.

The modules described herein represent instructions that can be storedin any type of computer-readable medium and can be implemented insoftware and/or hardware. All of the methods and processes describedabove can be embodied in, and fully automated via, software code modulesand/or computer-executable instructions executed by one or morecomputers or processors, hardware, or some combination thereof. Some orall of the methods can alternatively be embodied in specialized computerhardware.

Conditional language such as, among others, “can,” “could,” “may” or“might,” unless specifically stated otherwise, are understood within thecontext to present that certain examples include, while other examplesdo not include, certain features, elements and/or steps. Thus, suchconditional language is not generally intended to imply that certainfeatures, elements and/or steps are in any way required for one or moreexamples or that one or more examples necessarily include logic fordeciding, with or without user input or prompting, whether certainfeatures, elements and/or steps are included or are to be performed inany particular example.

Conjunctive language such as the phrase “at least one of X, Y or Z,”unless specifically stated otherwise, is to be understood to presentthat an item, term, etc. can be either X, Y, or Z, or any combinationthereof, including multiples of each element. Unless explicitlydescribed as singular, “a” means singular and plural.

Any routine descriptions, elements or blocks in the flow diagramsdescribed herein and/or depicted in the attached figures should beunderstood as potentially representing modules, segments, or portions ofcode that include one or more computer-executable instructions forimplementing specific logical functions or elements in the routine.Alternate implementations are included within the scope of the examplesdescribed herein in which elements or functions can be deleted, orexecuted out of order from that shown or discussed, includingsubstantially synchronously, in reverse order, with additionaloperations, or omitting operations, depending on the functionalityinvolved as would be understood by those skilled in the art.

It should be emphasized that many variations and modifications can bemade to the above-described examples, the elements of which are to beunderstood as being among other acceptable examples. All suchmodifications and variations are intended to be included herein withinthe scope of this disclosure and protected by the following claims.

What is claimed is:
 1. A system comprising: one or more processors; andone or more computer-readable media storing instructions executable bythe one or more processors, wherein the instructions, when executed,cause the system to perform operations comprising: receiving an imagehaving a first scale; providing the image to a first machine-learning(ML) model trained to output regions of interest (ROIs) having sizeswithin a first range of sizes, wherein the first ML model is trained tooutput the ROIs having the sizes within the first range of sizes basedat least in part on: training the first ML model, wherein the trainingcomprises: providing, as input to the first ML model, test images thatinclude test objects associated with areas defined by reference regions;and determining, by the first ML model and based at least in part on thetest images, multiple ROIs; determining degrees of alignment of themultiple ROIs to an area of the areas defined by the reference regions;and determining the first range of sizes based at least in part onidentifying a span of object sizes that corresponds to a portion of thedegrees of alignment that meet or exceed a threshold degree ofalignment; receiving, from the first ML model, a first ROI indicative ofa first region of the image representing at least part of a firstobject, the first ROI having a first size within the first range ofsizes; scaling, based at least in part on a second scale, the image as ascaled image, the scaled image and the image being different sizes;providing the scaled image to a second ML model trained to output ROIshaving sizes within a second range of sizes, wherein the first range ofsizes and the second range of sizes are different from each other; andreceiving, from the second ML model, a second ROI indicative of a secondregion of the image representing at least part of a second object, thesecond ROI having a second size within the second range of sizes.
 2. Thesystem as claim 1 recites, wherein the image is provided to the first MLmodel and the scaled image is provided to the second ML modelsubstantially simultaneously.
 3. The system as claim 1 recites, whereinthe first ML model and the second ML model are a same ML model.
 4. Thesystem as claim 1 recites, the operations further comprising:determining the first range of sizes for the first ML model based atleast in part on: providing, as input to the first ML model, a firstbatch of training images that include objects of different sizes;determining, based at least in part on ground truths associated with theobjects, accuracies of the first ML model as a function of ROI sizes;and determining the first range of sizes based at least in part onidentifying a range of ROI sizes that correspond to accuracies that meetor exceed a threshold accuracy.
 5. A computer-implemented methodcomprising: receiving a first scaled image and a second scaled image,the first scaled image and the second scaled image being two differentlysized versions of a same image; providing, as first input to a firstmachine-learning (ML) model trained to output regions of interest (ROIs)having sizes within a first range of sizes, the first scaled image,wherein the first ML model is trained to output the ROIs having thesizes within the first range of sizes based at least in part on:training the first ML model, wherein the training comprises: providing,as input to the first ML model, test images that include test objectsassociated with areas defined by reference regions; and determining, bythe first ML model and based at least in part on the test images,multiple ROIs; determining degrees of alignment of the multiple ROIs toan area of the areas defined by the reference regions; and determiningthe first range of sizes based at least in part on identifying a span ofobject sizes that corresponds to a portion of the degrees of alignmentthat meet or exceed a threshold degree of alignment; receiving, as firstoutput from the first ML model, one or more first ROIs having sizeswithin the first range of sizes; providing, as second input to a secondML model trained to output ROIs having sizes within a second range ofsizes, wherein the first range of sizes and the second range of sizesare different from each other, the second scaled image; and receiving,as second output from the second ML model, one or more second ROIshaving sizes within the second range of sizes.
 6. Thecomputer-implemented method as claim 5 recites, wherein: the imageincludes representations of a first object and a second object, and thecomputer-implemented method further comprises: determining, by the firstML model and based at least in part on the first scaled image, a firstROI that represents the first object and a second ROI that representsthe second object; and determining, by the second ML model and based atleast in part on the second scaled image, a third ROI that representsthe first object and a fourth ROI that represents the second object. 7.The computer-implemented method as claim 6 recites, wherein: the firstROI has a first size outside the first range of sizes; the second ROIhas a second size within the first range of sizes; the third ROI has athird size outside the second range of sizes; the fourth ROI has afourth size within the second range of sizes; the first ML modeldiscards the first ROI and outputs the second ROI; and the second MLmodel discards the fourth ROI and outputs the third ROI.
 8. Thecomputer-implemented method as claim 5 recites, further comprising:scaling, based at least in part on a first scale, the image to generatethe first scaled image; and scaling, based at least in part on a secondscale, the image to generate the second scaled image.
 9. Thecomputer-implemented method as claim 5 recites, wherein the first scaledimage is provided to the first ML model and the second scaled image isprovided to the second ML model substantially simultaneously.
 10. Thecomputer-implemented method as claim 5 recites, further comprisingdetermining the first range of sizes based at least in part on anaccuracy associated with a first ROI of the one or more first ROIs, thedetermining comprising: determining, based at least in part on a groundtruth associated with an area of the image representing an object, adegree of alignment of the first ROI to the area defined by the groundtruth; and determining the first range of sizes based at least in parton identifying a range of ROI sizes that corresponds to degrees ofalignment determined for the one or more first ROIs that meet or exceeda threshold degree of alignment.
 11. The computer-implemented method asclaim 5 recites, further comprising: receiving a batch of images,wherein the batch of images includes a first predefined number of imagesthat are associated with a first object classification and a secondpredefined number of images that are associated with a second objectclassification; and training the first ML model based at least in parton providing the batch of images as input to the first ML model, whereinthe first predefined number of images and the second predefined numberof images as based at least in part on a confidence score associatedwith the first ML model or the second ML model.
 12. A non-transitorycomputer-readable medium having a set of instructions that, whenexecuted, cause one or more processors to perform operations comprising:receiving a first scaled image and a second scaled image, the firstscaled image and the second scaled image corresponding to an image;providing, as first input to a first machine-learning (ML) model trainedto output regions of interest (ROIs) having sizes within a first rangeof sizes, the first scaled image, wherein the first ML model is trainedto output the ROIs having the sizes within the first range of sizesbased at least in part on: training the first ML model, wherein thetraining comprises: providing, as input to the first ML model, testimages that include test objects associated with areas defined byreference regions; and determining, by the first ML model and based atleast in part on the test images, multiple ROIs; determining degrees ofalignment of the multiple ROIs to an area of the areas defined by thereference regions; and determining the first range of sizes based atleast in part on identifying a span of object sizes that corresponds toa portion of the degrees of alignment that meet or exceed a thresholddegree of alignment; receiving, as first output from the first ML model,one or more first ROIs having sizes within the first range of sizes;providing, as second input to a second ML model trained to output ROIshaving sizes within a second range of sizes, wherein the first range ofsizes and the second range of sizes are different from each other, thesecond scaled image; and receiving, as second output from the second MLmodel, one or more second ROIs having sizes within the second range ofsizes.
 13. The non-transitory computer-readable medium as claim 12recites, wherein: the image includes representations of a first objectand a second object, and the operations further comprise: determining,by the first ML model and based at least in part on the first scaledimage, a first ROI that represents the first object and a second ROIthat represents the second object; and determining, by the second MLmodel and based at least in part on the second scaled image, a third ROIthat represents the first object and a fourth ROI that represents thesecond object.
 14. The non-transitory computer-readable medium as claim13 recites, wherein: the first ROI has a first size outside the firstrange of sizes; the second ROI has a second size within the first rangeof sizes; the third ROI has a third size outside the second range ofsizes; the fourth ROI has a fourth size within the second range ofsizes; the first ML model discards the first ROI and outputs the secondROI; and the second ML model discards the fourth ROI and outputs thethird ROI.
 15. The non-transitory computer-readable medium as claim 12recites, wherein the operations further comprise: scaling, based atleast in part on a first scale, the image to generate the first scaledimage; and scaling, based at least in part on a second scale, the imageto generate the second scaled image.
 16. The non-transitorycomputer-readable medium as claim 12 recites, wherein the first scaledimage is provided to the first ML model and the second scaled image isprovided to the second ML model substantially simultaneously.
 17. Thenon-transitory computer-readable medium as claim 12 recites, wherein theoperations further comprise determining the first range of sizes basedat least in part on an accuracy associated with a first ROI of the oneor more first ROIs, the determining comprising: determining, based atleast in part on a ground truth associated with an area of the imagerepresenting an object, a degree of alignment of the first ROI to thearea defined by the ground truth; and determining the first range ofsizes based at least in part on identifying a range of ROI sizes thatcorresponds to degrees of alignment determined for the one or more firstROIs that meet or exceed a threshold degree of alignment.
 18. Thenon-transitory computer-readable medium as claim 12 recites, wherein theoperations further comprise: receiving a batch of images, wherein thebatch of images includes a first predefined number of images that areassociated with a first object classification and a second predefinednumber of images that are associated with a second objectclassification; and training the first ML model based at least in parton providing the batch of images as input to the first ML model, whereinthe first predefined number of images and the second predefined numberof images as based at least in part on a confidence score associatedwith the first ML model or the second ML model.
 19. The non-transitorycomputer-readable medium as claim 12 recites, wherein the operationsfurther comprising determining to associate an ROI with a representationof an object in the image, wherein determining to associate the ROI withthe representation is based at least in part on determining to use thefirst ROIs or the second ROIs based at least in part on a dimension ofthe representation in the image, the first range of sizes, and thesecond range of sizes.